import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Random i=new Random();//Random随机生成数字 i来接收
        int num=i.nextInt(100);//生成1-100的数字
        Scanner scanner=new Scanner(System.in);
        while(true){
            System.out.println("任意输入一个1-100的数字:");
            int sum=scanner.nextInt();
            if(sum<num){
                System.out.println("猜小了");
            }else if(sum>num){
                System.out.println("猜大了");
            }else{
                System.out.println("恭喜你猜对了，答案是:"+num);
                break;
            }
        }
        scanner.close();
    }
}